import { createRouter, createWebHashHistory } from 'vue-router'
import RouterConstant from "./components/constant/routerConstant.js"
import Home from './views/home/home.vue'
import DeskTop from './views/home/desktop.vue'
import HomeDetail from './views/home/homeDetail.vue'
import RedisManage from './views/redisManage.vue'
import JsonTool from './views/jsonTool.vue'
import RandomTool from './views/randomTool.vue'
import WebSocketTool from './views/websocketTool.vue'
import QRCode from './views/qrCode.vue'
import CronTool from './views/cronTool.vue'
import EncryptionTool from './views/encryptionTool.vue'
import PostMan from './views/postMan.vue'
import ComingSoon from './views/comingSoon.vue'
import WinMonitor from './views/winMonitor.vue'

const routes = [
  {
    path: RouterConstant.DeskTop,
    component: DeskTop,
    meta: {
      title: '桌面悬浮'
    },
  },
  {
    path: RouterConstant.Home,
    component: Home,
    meta: {
      title: '首页'
    },
  },
  {
    path: RouterConstant.HomeDetail,
    component: HomeDetail,
    children: [
      {
        path: RouterConstant.RedisManage,
        component: RedisManage,
        meta: {
          title: 'Redis管理'
        }
      },
      {
        path: RouterConstant.ComingSoon,
        component: ComingSoon,
        meta: {
          title: '敬请期待'
        }
      },
      {
        path: RouterConstant.QrCode,
        component: QRCode,
        meta: {
          title: '二维码'
        }
      },
      {
        path: RouterConstant.WinMonitor,
        component: WinMonitor,
        meta: {
          title: 'Windows监控'
        }
      },
      {
        path: RouterConstant.JsonTool,
        component: JsonTool,
        meta: {
          title: 'Json工具'
        }
      },
      {
        path: RouterConstant.RandomTool,
        component: RandomTool,
        meta: {
          title: '随机字符'
        }
      },
      {
        path: RouterConstant.WebSocketTool,
        component: WebSocketTool,
        meta: {
          title: 'WebSocket连接'
        }
      },
      {
        path: RouterConstant.PostMan,
        component: PostMan,
        meta: {
          title: 'postMan'
        }
      },
      {
        path: RouterConstant.CronTool,
        component: CronTool,
        meta: {
          title: 'Cron工具'
        }
      },
      {
        path: RouterConstant.EncryptionTool,
        component: EncryptionTool,
        meta: {
          title: '加密工具'
        }
      }
    ]
  }
]
const router = createRouter({
  history: createWebHashHistory(),
  routes
})
export default router
